<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Title</title>
</head>
<body>
<div>是否获取： <span class="isObtain"></span></div>
<div>手机号码： <span class="phone"></span></div>
<div>智能卡号： <span class="card"></span></div>
</body>
<script>
    let cssClass = ['phone', 'card']
    document.getElementsByClassName('isObtain')[0].innerHTML = getQueryString('isObtain') !== 'true' ? '不获取' : '获取'
    cssClass.forEach(key => {
        document.getElementsByClassName(key)[0].innerHTML = getQueryString(key)
    })

    function getQueryString(name) {
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        let r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
</script>
</html>
